[#import "/framework/JGP.htm"  as JGP]
<!--
项目   Bsm
作者   fdp
时间   2018/7/23
-->
[@JGP.head "Title"/]
[@JGP.body]
<jgp-div slot="2-1" _row="['8','*']" _aux="true">
        <jgp-div slot="1-1" _col="['*','*','*']" _aux="false" >
            <jgp-query slot="1-1"  _target="grid" _id="query" _auto="false" _page_size="12">
                <jgp-text   _col="8" _placeholder="搜索会议总管" _name="name" ></jgp-text>
                <jgp-btn  _fn="search" _margin="5" _icon="search">搜索</jgp-btn>
            </jgp-query>
            <jgp-btn slot="1-2" _margin="5" _fn="addManager">添加会议总管</jgp-btn>
        </jgp-div>

        <jgp-grid  _id="grid" slot="2-1"  _record_tools="[{'icon':'edit','tip':'编辑','fn':'editManager'},{'icon':'window-restore','fn':'addFields'},{'icon':'times-rectangle','tip':'删除','fn':'removeManager'}]"
                   _index="true"></jgp-grid>

    </jgp-div>






[/@JGP.body]

[@JGP.foot]
<script>
    //  _action="/webBsm/pages/ajax/queryMeeting"
    //页面渲染完成之后调用,列表初始化
    JGP.$onload(search())

    //手动搜索
    function search() {
        JGP.query('query').searchTo('/glMeeting/managerApiController/queryManager',function () {

        },function () {

        });
    }
    //点击新建会议总管弹出框

    function addManager(re){
        var config = {
            url:'/glMeeting/managerController/addManager',
            title:"添加会议总管",
            callback:function(res){
                if(res==true){
                    window.location.reload();
                }
            },
            width:'300px',
            height:'300px'
        }
        JGP.$dialog(config)
    }

    //点击编辑修改
    function editManager(re){
        var config = {
            url:'/glMeeting/managerController/editManager/'+re.back.id,
            title:"修改会议总管信息",
            callback:function(res){
                // console.log(res)
                if(res==true){
                    window.location.reload();
                }
            },
            width:'300px',
            height:'300px'
        }
        JGP.$dialog(config)
    }

    //删除会议总管
    function removeManager(re) {
        JGP.$confirm("是否确认删除",function () {
            JGP.$post('/glMeeting/managerApiController/removeManager',{id:re.back.id},function (res) {
                JGP.$alert("删除成功")
                if (res.flag==true) {
                    window.location.reload();
                }
            })
        })
    }


</script>
[/@JGP.foot]